Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(config): read using utf-8 #1002

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

AmaseCocoa
Copy link

@AmaseCocoa AmaseCocoa commented Aug 9, 2024

Change Summary

Changed path.read_text to explicitly use utf-8 to avoid UnicodeEncodeError that may be caused by cp932 in Japanese Windows environments.

src/prisma/_config.py and tests/test_config.py was changed.

(This is my first time contributing to another repository, so there may be some clumsiness, but I'd appreciate it if you could let me know if that's the case.)

Checklist

  • Unit tests for the changes exist
  • Tests pass without significant drop in coverage
  • Documentation reflects changes where applicable
  • Test snapshots have been updated if applicable

Agreement

By submitting this pull request, I confirm that you can use, modify, copy and redistribute this contribution, under the terms of your choice.

Copy link
Owner

@RobertCraigie RobertCraigie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

It'd be great if you could add a unit test for this case to tests/test_config.py. We have some existing tests for config loading there which you can take inspiration from :)

@RobertCraigie RobertCraigie changed the title Explicitly use utf-8 in path.read_text fix(config): read using utf-8 Aug 9, 2024
@AmaseCocoa
Copy link
Author

AmaseCocoa commented Aug 9, 2024

Added Unit Test (test_with_file) to tests/test_config.py :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants